package main

import (
	"fmt"
	"strings"
)


//判断文件名结尾
func panduan(f string) func(name string)string  {
	return func(name string)string {
		if !strings.HasSuffix(name , f){
			return  name + f
			}
		return name
	}
}

func main() {
	jpg := panduan(".jpg")
	txt := panduan(".txt")
	fmt.Println(jpg("hello"))
	fmt.Println(txt("ab.txt"))
}
